<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../css/login.css">
    <title>注册</title>
</head>
<body>
<div style="background: url(../images/register-bg.png) no-repeat;height: 100%;  overflow: hidden;">
    <div class="main-register">
        <ul>
            <li>
                <div class="icon">
                    <img src="../images/userpic.png" width="100%">
                </div>
                <div class="input">
                    <input type="text" id="username" placeholder="请输入真实姓名">
                </div>
            </li>

            <li>
                <div class="icon">
                    <img src="../images/mobile.png" width="100%">
                </div>
                <div class="input">
                    <input type="text" id="mobile" placeholder="请输入手机号">
                </div>

            </li>
        </ul>
    </div>
    <div class="comfirm" onclick="submit()">
        <p>确认登陆</p>
    </div>
</div>
</body>
</html>
<script src="../assets/js/jquery.min.js" type="text/javascript"></script>
<script src="../bower_components/seajs/dist/sea.js"></script>
<script src="../bower_components/ejs.js"></script>
<script>

    var nums = null;
    function submit() {
        var ismobile = /^1[34578]\d{9}$/;
        nums = $("#mobile").val();
        username =$("#username").val();
        if(username == ''){
            toast.show('用户名不能为空！')
        }
        if (nums == '') {
            toast.show('手机号码不为空！');
        }
        if (!ismobile.test(nums)) {
            toast.show('请输入正确格式的手机号');
            return;
        }
        var mobile=$("#mobile").val();
        var params ={
            id:user.id,
            mobile:mobile,
            username:username
        }
        $.post("/user/adduser", params, function (res){
           if(res.success){
               MAIN.spotView()
           }else{
               toast.show('注册失败!');

           }
        })
    }
</script>